package com.company.cloud.customer.modules.api.fallback;

import java.util.List;

import com.company.cloud.common.bean.BaseClientResult;
import org.springframework.stereotype.Component;

import com.company.cloud.customer.modules.api.response.AddrResponse;
import com.company.cloud.customer.modules.api.service.CustomerRemoteService;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;

@Log4j2
@Component
public class CustomerRemoteServiceFallbackFactory implements FallbackFactory<CustomerRemoteService>{

	@Override
	public CustomerRemoteService create(Throwable cause) {
		return new CustomerRemoteService() {
			@Override
			public BaseClientResult<List<AddrResponse>> getAddrList(Integer userId) {
				return BaseClientResult.callbackError();
			}
			@Override
			public BaseClientResult<AddrResponse> getAddrById(Integer id) {
				return BaseClientResult.callbackError();
			}

		};
	}

}
